home *** CD-ROM | disk | FTP | other *** search
/ GameSpot.it / GameSpot Italia (2001).bin / demo / severancedemo / data1.cab / Program_Files / Maps / Casa / selec.py < prev    next >
Text File  |  2000-10-13  |  36KB  |  1,025 lines

  1. import Menu
  2. import Bladex
  3. import Scorer
  4. import ScorerWidgets
  5. import BUIx
  6. import AuxFuncs
  7. import BBLib
  8. import ItemTypes
  9. import Reference #Para demo_mode flag...
  10. import GameText
  11. import MenuText
  12. import KeybWidget
  13.  
  14. execfile ("..\\..\\data\\text\\spanish\\casa.py")
  15.  
  16. Bladex.LoadSampledAnimation("../../Anm/Kgt_seleccion.BMV","Kgt_seleccion",1,"Knight_N")
  17. #Bladex.LoadSampledAnimation("../../Anm/Gladius.BMV","Gladius",1,"GladiusSeleccion")
  18. #Bladex.LoadSampledAnimation("../../Anm/Shield_Kgt_seleccion.BMV","Shield_kgt_seleccion",1,"Shield_Kgt_seleccion")
  19.  
  20. Bladex.LoadSampledAnimation("../../Anm/Amz_seleccion.BMV","Amz_seleccion",1,"Amazon_N")
  21. #Bladex.LoadSampledAnimation("..\\..\\Anm\\Arco_Amz_seleccion.BMV","Arco_amz_seleccion",1,"Arco_Amz_seleccion")
  22. #Bladex.LoadSampledAnimation("..\\..\\Anm\\Flecha_Amz_seleccion.BMV","Flecha_amz_seleccion",1,"Flecha_Amz_seleccion")
  23. Bladex.LoadSampledAnimation("../../Anm/Carcaj_Amz_seleccion.BMV","Carcaj_amz_seleccion",1,"Carcaj_Amz_seleccion")
  24.  
  25. Bladex.SetAnimationFactor("Amz_seleccion",3)
  26. #Bladex.SetAnimationFactor("Arco_amz_seleccion",3)
  27. #Bladex.SetAnimationFactor("Flecha_amz_seleccion",3)
  28. Bladex.SetAnimationFactor("Carcaj_amz_seleccion",3)
  29.  
  30. Bladex.LoadSampledAnimation("../../Anm/Dwf_seleccion.BMV","Dwf_seleccion",1,"Dwarf_N")
  31. #Bladex.LoadSampledAnimation("..\\..\\Anm\\Axe_Dwf_seleccion.BMV","Axe_dwf_seleccion",1,"Axe_Dwf_seleccion")
  32. Bladex.LoadSampledAnimation("../../Anm/Jar_Dwf_seleccion.BMV","Jar_dwf_seleccion",1,"Jar_Dwf_seleccion")
  33.  
  34. Bladex.SetAnimationFactor("Dwf_seleccion",3)
  35. Bladex.SetAnimationFactor("Jar_dwf_seleccion",3)
  36. #Bladex.SetAnimationFactor("Axe_dwf_seleccion",3)
  37.  
  38. Bladex.LoadSampledAnimation("../../Anm/Bar_seleccion.BMV","Bar_seleccion",1,"Barbarian_N")
  39. Bladex.LoadSampledAnimation("../../Anm/Piedra_bar_seleccion.BMV","Piedra_bar_seleccion",1,"Piedra_Bar_seleccion")
  40. Bladex.LoadSampledAnimation("../../Anm/Espada_bar_seleccion.BMV","Espada_bar_seleccion",1,"Espada_Bar_seleccion")
  41.  
  42. Bladex.SetAnimationFactor("Bar_seleccion",3)
  43. Bladex.SetAnimationFactor("Piedra_bar_seleccion",3)
  44. Bladex.SetAnimationFactor("Espada_bar_seleccion",3)
  45.  
  46. def GraspString (EntityName,EventName): 
  47.     bow= Bladex.GetEntity("ArcoAmz")
  48.     bow.Data.GraspString()
  49.  
  50. def UnGraspString (EntityName,EventName):
  51.     me= Bladex.GetEntity(EntityName)
  52.     bow= Bladex.GetEntity("ArcoAmz")
  53.     bow.Data.UnGraspString()
  54.     
  55.     #release arrow
  56.     arrow= Bladex.GetEntity("FlechaAmz")
  57.     arrow.ExcludeHitFor(me)
  58.     arrow.PutToWorld()
  59.     me.Unlink(arrow)
  60.     vx,vy,vz= arrow.Rel2AbsVector(0,0,-40000)
  61.     arrow.Fly(vx,vy,vz)
  62.  
  63. def TakeArrow (EntityName,EventName):
  64.     me= Bladex.GetEntity(EntityName)
  65.     arrow= Bladex.GetEntity("FlechaAmz")
  66.     arrow.Stop()
  67.     me.LinkAnchors("R_Hand",arrow,"1H_R")
  68.  
  69. def PickUpBowToLeft (EntityName,EventName): 
  70.     me= Bladex.GetEntity(EntityName)
  71.     bow= Bladex.GetEntity("ArcoAmz")
  72.     me.LinkAnchors("L_Hand",bow,"1H_L")
  73.  
  74. def LeftDrop (EntityName,EventName):    
  75.     me= Bladex.GetEntity(EntityName)
  76.     bow= Bladex.GetEntity("ArcoAmz")
  77.     me.Unlink(bow)
  78.  
  79. def EndAnmAmz(name):
  80.     time= Bladex.GetTime()
  81.     PickUpBowToLeftTime= 336.0/60.0
  82.     LeftDropTime= 768.0/60.0
  83.     TakeArrowTime= 580.0/60.0
  84.     GraspStringTime= 600.0/60.0
  85.     UnGraspStringTime= 646.0/60.0
  86.     Bladex.AddScheduledFunc(time+PickUpBowToLeftTime, PickUpBowToLeft,(name, "PickUpBowToLeft"),"PickUpBowToLeft")
  87.     Bladex.AddScheduledFunc(time+LeftDropTime,        LeftDrop,       (name, "LeftDrop"),       "LeftDrop")
  88.     Bladex.AddScheduledFunc(time+TakeArrowTime,       TakeArrow,      (name, "TakeArrow"),      "TakeArrow")
  89.     Bladex.AddScheduledFunc(time+GraspStringTime,     GraspString,    (name, "GraspString"),    "GraspString")
  90.     Bladex.AddScheduledFunc(time+UnGraspStringTime,   UnGraspString,  (name, "UnGraspString"),  "UnGraspString")
  91.  
  92.  
  93. def SetCameraInicio():
  94.     global CurrentPerson
  95.     global FinishPerson
  96.  
  97.     CurrentPerson = 2
  98.     FinishPerson = 2
  99.  
  100.     cam = Bladex.GetEntity("Camera")
  101.     cam.SetMaxCamera("Seleccion_Camera_seleccion_caballero.cam",0,-1)
  102.     AuxFuncs.FadeFrom(0.5, 0.5)
  103.  
  104. #Bladex.AddScheduledFunc(Bladex.GetTime(),SetCameraInicio,())
  105. SetCameraInicio()
  106.  
  107. def LanzarAnimacionActor():
  108.     SonidosDelKavayero()
  109.     SonidosDelEnano()
  110.     SonidosDelBarbaro()
  111.     SonidosDeLaAmazona()
  112.     
  113.     cab = Bladex.GetEntity("Caballero")
  114.     amz = Bladex.GetEntity("Amazona")
  115.     ena = Bladex.GetEntity("Enano")
  116.     bar = Bladex.GetEntity("Barbaro")
  117.  
  118.     glad = Bladex.GetEntity("WeaponActor1")
  119.     escudo = Bladex.GetEntity("EscudoActor1")
  120.     arco = Bladex.GetEntity("ArcoAmz")
  121.     #flecha = Bladex.GetEntity("FlechaAmz")
  122.     carcaj = Bladex.GetEntity("CarcajAmz")
  123.     jarra = Bladex.GetEntity("JarraDwf")
  124.     #hacha = Bladex.GetEntity("HachaDwf")
  125.     piedra = Bladex.GetEntity("PiedraBar")
  126.     espada = Bladex.GetEntity("EspadaBar")
  127.  
  128.     #glad.Position = 15751,-8338,-12536
  129.     #glad.Actor = 1
  130.     #glad.Animation = "Gladius"
  131.     
  132.     #escudo.Position = 16405,-8249,-12193
  133.     #escudo.Actor = 1
  134.     #escudo.Animation = "Shield_kgt_seleccion"           
  135.     
  136.     #flecha.Position = 15238,-1318,22399
  137.     #flecha.Position = 14793,-1379,22214
  138.     #14789,1305,22220
  139.  
  140.     #flecha.Actor = 1
  141.     #flecha.Animation = "Flecha_amz_seleccion"
  142.     #flecha.Alpha = 0.0
  143.  
  144.     carcaj.Position = 14656,-801,22334
  145.     carcaj.Actor = 1
  146.     carcaj.Animation = "Carcaj_amz_seleccion"
  147.  
  148.     jarra.Position = 12077,-355,10356
  149.     jarra.Actor = 1
  150.     jarra.Animation = "Jar_dwf_seleccion"
  151.  
  152.     #hacha.Position = 11862,-691,9307
  153.     #hacha.Position = 11976,-691,9307
  154.     #hacha.Actor = 1
  155.     #hacha.Animation = "Axe_dwf_seleccion"
  156.  
  157.     piedra.Position = -957,-149,-3251
  158.     piedra.Actor = 1
  159.     piedra.Animation = "Piedra_bar_seleccion"
  160.  
  161.     espada.Position = -630,-30,-3126
  162.     espada.Actor = 1
  163.     espada.Animation = "Espada_bar_seleccion"
  164.  
  165.     cab.Position = 16039, -8388,-11988
  166.     cab.Actor = 1
  167.     cab.Animation = "Kgt_seleccion"
  168.     
  169.     amz.Position = 14881, -1082,22235   
  170.     amz.Actor = 1   
  171.     #amz.AddAnmEventFunc("PickUpBowToLeft", PickUpBowToLeft)
  172.     #amz.AddAnmEventFunc("LeftDrop", LeftDrop)
  173.     #amz.AddAnmEventFunc("GraspString", GraspString)
  174.     #amz.AddAnmEventFunc("UnGraspString", UnGraspString)
  175.     amz.Animation="Amz_seleccion"
  176.     EndAnmAmz (amz.Name)
  177.     amz.OnAnimationEndFunc= EndAnmAmz
  178.  
  179.     ena.Position = 11563, -827,9813 
  180.     ena.Actor = 1
  181.     ena.Animation = "Dwf_seleccion"
  182.  
  183.     bar.Position = -99, -616,-3233  
  184.     bar.Actor = 1
  185.     bar.Animation = "Bar_seleccion"
  186.     
  187.     cab.LinkAnchors("R_Hand",glad,"1H_R")
  188.     cab.LinkAnchors("Shield",escudo,"Shield")
  189.  
  190.     glad.TurnOn()
  191.     escudo.TurnOn()
  192.     #flecha.TurnOn()
  193.     carcaj.TurnOn()
  194.     jarra.TurnOn()
  195.     #hacha.TurnOn()
  196.     piedra.TurnOn()
  197.     espada.TurnOn()
  198.     cab.TurnOn()
  199.     amz.TurnOn()
  200.     ena.TurnOn()    
  201.     bar.TurnOn()    
  202.  
  203.  
  204. def CreateActor():
  205.     char=Bladex.CreateEntity("Caballero","Knight_N",0,0,0)
  206.     char.RotateRel(0,0,0,1,0,0,1.57)
  207.     char.Static = 1
  208.  
  209.     glad=Bladex.CreateEntity("WeaponActor1","Gladius",0,0,0,"Weapon")
  210.     #glad.RotateRel(0,0,0,1,0,0,1.57)
  211.     #glad.Static = 1 
  212.  
  213.     escudo=Bladex.CreateEntity("EscudoActor1","Escudo3",0,0,0,"Weapon")
  214.     #escudo.RotateRel(0,0,0,1,0,0,1.57)
  215.     #escudo.Static = 1       
  216.  
  217.     arco=Bladex.CreateEntity("ArcoAmz","Arco2",16336,-671,22801,"Weapon")   
  218.     arco.Orientation=(0.499056011438, -0.50122833252, 0.49957087636, -0.500142157078)
  219.     arco.Data= ItemTypes.Arco_Amz_seleccion(arco)
  220.     
  221.  
  222.     flecha=Bladex.CreateEntity("FlechaAmz","Flecha",0,0,0,"Arrow")
  223.     #flecha.RotateRel(0,0,0,1,0,0,1.57)
  224.     #flecha.Static = 1
  225.     
  226.     carcaj=Bladex.CreateEntity("CarcajAmz","Carcaj_Amz_seleccion",0,0,0)
  227.     carcaj.RotateRel(0,0,0,1,0,0,1.57)
  228.     carcaj.Static = 1   
  229.  
  230.     taburete=Bladex.CreateEntity("TabureteDwf","Taburete_Dwf_seleccion",11537,-430,9786)
  231.     taburete.RotateRel(0,0,0,1,0,0,1.57)
  232.     
  233.     #hacha=Bladex.CreateEntity("HachaDwf","Axe_Dwf_seleccion",0,0,0)
  234.     #hacha.RotateRel(0,0,0,1,0,0,1.57)
  235.     #hacha.Static = 1
  236.  
  237.     jarra=Bladex.CreateEntity("JarraDwf","Jar_Dwf_seleccion",0,0,0)
  238.     jarra.RotateRel(0,0,0,1,0,0,1.57)
  239.     jarra.Static = 1
  240.  
  241.     piedra=Bladex.CreateEntity("PiedraBar","Piedra_Bar_seleccion",0,0,0)
  242.     piedra.RotateRel(0,0,0,1,0,0,1.57)
  243.     piedra.Static = 1
  244.     
  245.     espada=Bladex.CreateEntity("EspadaBar","Espada_Bar_seleccion",0,0,0)
  246.     espada.RotateRel(0,0,0,1,0,0,1.57)
  247.     espada.Static = 1
  248.  
  249.     pvarias=Bladex.CreateEntity("PiedrasVarias","PiedrasBarbaro",-684,103,-3346)
  250.     pvarias.RotateRel(0,0,0,1,0,0,1.57)
  251.     
  252.  
  253.     char=Bladex.CreateEntity("Amazona","Amazon_N",0,0,0)
  254.     char.RotateRel(0,0,0,1,0,0,1.57)
  255.     char.Static = 1
  256.  
  257.     char=Bladex.CreateEntity("Enano","Dwarf_N",0,0,0)
  258.     char.RotateRel(0,0,0,1,0,0,1.57)
  259.     char.Static = 1
  260.  
  261.     char=Bladex.CreateEntity("Barbaro","Barbarian_N",0,0,0)
  262.     char.RotateRel(0,0,0,1,0,0,1.57)
  263.     char.Static = 1
  264.  
  265. CreateActor()
  266.  
  267. Bladex.AddScheduledFunc(Bladex.GetTime()+0.0, LanzarAnimacionActor,())
  268.  
  269. CurrentPerson = 2
  270. FinishPerson = 2
  271. Stoped = 1
  272. StateArrow = 1
  273.  
  274. CameraPerson = ["Seleccion_Camera_seleccion_amazona.cam","Seleccion_Camera_seleccion_barbaro.cam","Seleccion_Camera_seleccion_caballero.cam","Seleccion_Camera_seleccion_enano.cam"]
  275. CameraAvance = ["Seleccion_Camera_amazona_barbaro.cam","Seleccion_Camera_barbaro_caballero.cam","Seleccion_Camera_caballero_enano.cam","Seleccion_Camera_enano_amazona.cam"]
  276. CameraRetroc = ["Seleccion_Camera_barbaro_amazona.cam","Seleccion_Camera_caballero_barbaro.cam","Seleccion_Camera_enano_caballero.cam","Seleccion_Camera_amazona_enano.cam"]
  277. MapaPerson = ["Ruins_M4","Barb_M1","Ragnar_M2","Dwarf_M3"]
  278.  
  279. FrameCamera = [60,50,60,47]
  280.  
  281.  
  282. def StopRecorridoCamera(Camera,Frame):
  283.     global Stoped
  284.  
  285.     if CurrentPerson == FinishPerson:
  286.         cam = Bladex.GetEntity("Camera")
  287.         cam.SetMaxCamera(CameraPerson[CurrentPerson],0,-1)
  288.         Stoped = 1
  289.         FadeArrow(2)
  290.         SelectCharacterWidget.SetVisible(1)
  291.     else:       
  292.         ChangePersonCamera()
  293.  
  294.  
  295. def ChangePersonCamera():
  296.     global CurrentPerson
  297.     global Stoped
  298.  
  299.     if Stoped:      
  300.         FadeArrow(1)
  301.         SelectCharacterWidget.SetVisible(0)
  302.  
  303.     #FlechaIzqWidget.SetVisible(0)
  304.     #FlechaDerWidget.SetVisible(0)
  305.  
  306.     Stoped = 0
  307.  
  308.     cam = Bladex.GetEntity("Camera")
  309.     dist = FinishPerson - CurrentPerson
  310.  
  311.     if CurrentPerson < FinishPerson:
  312.         if dist < 3:
  313.             cam.SetMaxCamera(CameraAvance[CurrentPerson],0,FrameCamera[CurrentPerson])
  314.             CurrentPerson = CurrentPerson + 1
  315.         else:
  316.             CurrentPerson = 3
  317.             cam.SetMaxCamera(CameraRetroc[CurrentPerson],0,FrameCamera[CurrentPerson])
  318.     else:
  319.         if dist > -3:
  320.             CurrentPerson = CurrentPerson - 1
  321.             cam.SetMaxCamera(CameraRetroc[CurrentPerson],0,FrameCamera[CurrentPerson])
  322.         else:
  323.             cam.SetMaxCamera(CameraAvance[CurrentPerson],0,FrameCamera[CurrentPerson])
  324.             CurrentPerson = 0
  325.  
  326.     cam.AddCameraEvent(-1,StopRecorridoCamera)
  327.  
  328. def PressKeyZ():    
  329.     global FinishPerson
  330.  
  331.     if (YesNoActivated):
  332.         ActivateWidgetYesNo()
  333.     elif Stoped:
  334.         if FinishPerson == 0:
  335.             FinishPerson = 3
  336.         else:
  337.             FinishPerson = FinishPerson - 1
  338.  
  339.         ChangePersonCamera()
  340.  
  341. def PressKeyX():    
  342.     global FinishPerson
  343.  
  344.     if (YesNoActivated):    
  345.         ActivateWidgetYesNo()
  346.     elif Stoped:
  347.         if FinishPerson == 3:
  348.             FinishPerson = 0
  349.         else:
  350.             FinishPerson = FinishPerson + 1
  351.  
  352.         ChangePersonCamera()
  353.  
  354. #def LoadTheMap():
  355. #   Bladex.LoadLevel(MapaPerson[CurrentPerson])
  356.  
  357. FlechaDerWidget = 0
  358. FlechaIzqWidget = 0
  359. SelectCharacterWidget = 0
  360. AreYouSureWidget = 0
  361. YesWidget = 0
  362. NoWidget = 0
  363. YesNoValue = 1
  364. YesNoActivated = 0
  365. InfoCharWidget1 = 0
  366. InfoCharWidget2 = 0
  367. InfoCharWidget3 = 0
  368. InfoCharWidget4 = 0
  369. fondo1 = 0
  370. fondo2 = 0
  371. fondo3 = 0
  372.  
  373.  
  374.  
  375.  
  376. marco1 = 0
  377. marco2 = 0
  378. marco3 = 0
  379. marco4 = 0
  380. marco5 = 0
  381. marco6 = 0
  382.  
  383. #Size_X = Scorer.wFrame.GetSize()[0]
  384. #Size_Y = Scorer.wFrame.GetSize()[1]
  385. #Size_X = 800.0
  386. #Size_Y = 600.0
  387. #import Raster
  388.  
  389. #Size_X = Raster.GetSize()[0]
  390. #Size_Y = Raster.GetSize()[1]
  391. ##Size_X=640
  392. Size_Y=480
  393.  
  394. #print "Resolucion Raster"
  395. #print Raster.GetSize()
  396.  
  397. ##Scorer.wFrame.SetAutoScale(0)
  398.  
  399. #ARX = Size_X / 640.0
  400. #ARY = Size_Y / 480.0
  401.  
  402.  
  403. MarcoAnchoTex = 256.0
  404. MarcoAltoTex = 256.0 
  405.  
  406.  
  407. #RasterRes = 
  408.  
  409. def SlideFrame(dir,time = 0):
  410.     if time < 1.0:
  411.         Bladex.AddScheduledFunc(Bladex.GetTime() + 0.025,SlideFrame,(dir,time + 0.05))
  412.     else:
  413.         time = 1.0
  414.  
  415.         if dir:
  416.             marco1.SetVisible(0)
  417.             marco2.SetVisible(0)
  418.             marco3.SetVisible(0)
  419.             marco4.SetVisible(0)
  420.             marco5.SetVisible(0)
  421.             marco6.SetVisible(0)
  422.         
  423.     if dir:
  424.         Y_UP = -MarcoAltoTex * time
  425.         Y_DOWN = (Size_Y - MarcoAltoTex) + MarcoAltoTex * time
  426.     else:
  427.         Y_UP = -MarcoAltoTex + MarcoAltoTex * time
  428.         Y_DOWN = Size_Y - MarcoAltoTex * time
  429.         
  430.     Scorer.wFrame.MoveWidgetTo("Marco1",0,Y_UP)
  431.     Scorer.wFrame.MoveWidgetTo("Marco2",MarcoAnchoTex,Y_UP)
  432.     Scorer.wFrame.MoveWidgetTo("Marco3",MarcoAnchoTex * 2.0,Y_UP)
  433.  
  434.     Scorer.wFrame.MoveWidgetTo("Marco4",0,Y_DOWN)
  435.     Scorer.wFrame.MoveWidgetTo("Marco5",MarcoAnchoTex,Y_DOWN)
  436.     Scorer.wFrame.MoveWidgetTo("Marco6",MarcoAnchoTex * 2.0,Y_DOWN)
  437.  
  438.  
  439. def CreateWidgetMarco():
  440.     global marco1
  441.     global marco2
  442.     global marco3
  443.     global marco4
  444.     global marco5
  445.     global marco6
  446.  
  447.     TamX = 256.0
  448.     TamY = 256.0
  449.  
  450.     marco1=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco1",256,256,"1","../../Data/seleccionpersonaje.mmp")
  451.     marco1.SetColor(255,255,255)
  452.     Scorer.wFrame.AddWidget(marco1,0,0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  453.     marco1.SetSize(TamX,TamY)
  454.     marco1.SetAlpha(1.0)
  455.     marco1.SetVisible(0)
  456.     marco1.SetAutoScale(2)
  457.  
  458.  
  459.     marco2=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco2",256,256,"2","../../Data/seleccionpersonaje.mmp")
  460.     marco2.SetColor(255,255,255)
  461.     Scorer.wFrame.AddWidget(marco2,256,0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  462.     marco2.SetSize(TamX,TamY)
  463.     marco2.SetAlpha(1.0)
  464.     marco2.SetVisible(0)
  465.     marco2.SetAutoScale(2)
  466.  
  467.     marco3=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco3",256,256,"3","../../Data/seleccionpersonaje.mmp")
  468.     marco3.SetColor(255,255,255)
  469.     Scorer.wFrame.AddWidget(marco3,512,0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  470.     marco3.SetSize(TamX,TamY)
  471.     marco3.SetAlpha(1.0)
  472.     marco3.SetVisible(0)
  473.     marco3.SetAutoScale(2)
  474.  
  475.     marco4=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco4",256,256,"4","../../Data/seleccionpersonaje.mmp")
  476.     marco4.SetColor(255,255,255)
  477.     Scorer.wFrame.AddWidget(marco4,0,480-256,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  478.     marco4.SetSize(TamX,TamY)
  479.     marco4.SetAlpha(1.0)
  480.     marco4.SetVisible(0)
  481.     marco4.SetAutoScale(2)
  482.  
  483.     marco5=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco5",256,256,"5","../../Data/seleccionpersonaje.mmp")
  484.     marco5.SetColor(255,255,255)
  485.     Scorer.wFrame.AddWidget(marco5,256,480-256,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  486.     marco5.SetSize(TamX,TamY)
  487.     marco5.SetAlpha(1.0)
  488.     marco5.SetVisible(0)
  489.     marco5.SetAutoScale(2)
  490.  
  491.     marco6=BUIx.B_BitmapWidget(Scorer.wFrame,"Marco6",256,256,"6","../../Data/seleccionpersonaje.mmp")
  492.     marco6.SetColor(255,255,255)
  493.     Scorer.wFrame.AddWidget(marco6,512,480-256,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  494.     marco6.SetSize(TamX,TamY)
  495.     marco6.SetAlpha(1.0)
  496.     marco6.SetVisible(0)
  497.     marco6.SetAutoScale(2)
  498.     
  499.  
  500. def CreateWidgetInfoChar():
  501.     global InfoCharWidget1
  502.     global InfoCharWidget2
  503.     global InfoCharWidget3
  504.     global InfoCharWidget4
  505.     global FlechaDerWidget
  506.     global FlechaIzqWidget
  507.  
  508.     InfoCharWidget1=BUIx.B_TextWidget(Scorer.wFrame,"InfoChar1","",ScorerWidgets.font_server,"../../Data/Letras menu gra.bmp")
  509.     InfoCharWidget1.SetText(TextInfoCharAmz1)
  510.     InfoCharWidget1.SetAlpha(1)
  511.     InfoCharWidget1.SetColor(255,0,0)   
  512.     Scorer.wFrame.AddWidget(InfoCharWidget1,0.5,100.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  513.     InfoCharWidget1.SetVisible(0)
  514.     InfoCharWidget1.SetAutoScale(1)
  515.  
  516.     InfoCharWidget2=BUIx.B_TextWidget(Scorer.wFrame,"InfoChar2","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  517.     InfoCharWidget2.SetText(TextInfoCharAmz2)
  518.     InfoCharWidget2.SetAlpha(1)
  519.     InfoCharWidget2.SetColor(254,254,202)   
  520.     #Scorer.wFrame.AddWidget(InfoCharWidget2,0.475,140.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  521.     Scorer.wFrame.AddWidget(InfoCharWidget2,0.5,140.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  522.     InfoCharWidget2.SetVisible(0)
  523.     InfoCharWidget2.SetAutoScale(1)
  524.  
  525.     InfoCharWidget3=BUIx.B_TextWidget(Scorer.wFrame,"InfoChar3","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  526.     InfoCharWidget3.SetText(TextInfoCharAmz3)
  527.     InfoCharWidget3.SetAlpha(1)
  528.     InfoCharWidget3.SetColor(254,116,4) 
  529.     #Scorer.wFrame.AddWidget(InfoCharWidget3,0.49,290.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  530.     Scorer.wFrame.AddWidget(InfoCharWidget3,0.5,290.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  531.     InfoCharWidget3.SetVisible(0)
  532.     InfoCharWidget3.SetAutoScale(1)
  533.  
  534.     InfoCharWidget4=BUIx.B_TextWidget(Scorer.wFrame,"InfoChar4","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  535.     InfoCharWidget4.SetText(TextInfoCharAmz4)
  536.     InfoCharWidget4.SetAlpha(1)
  537.     InfoCharWidget4.SetColor(247,255,171)   
  538.     Scorer.wFrame.AddWidget(InfoCharWidget4,0.5,320.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  539.     InfoCharWidget4.SetVisible(0)
  540.     InfoCharWidget4.SetAutoScale(1)
  541.  
  542.  
  543.     FlechaIzqWidget=BUIx.B_TextWidget(Scorer.wFrame,"FlechaIzqWidget","<",ScorerWidgets.font_server,"../../Data/Letras menu gra.bmp")
  544.     FlechaIzqWidget.SetAlpha(1)
  545.     FlechaIzqWidget.SetColor(128,128,128)   
  546.     FlechaIzqWidget.SetText("<")    
  547.     Scorer.wFrame.AddWidget(FlechaIzqWidget,0.03,15,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  548.     FlechaIzqWidget.SetVisible(1)
  549.     FlechaIzqWidget.SetAutoScale(1)
  550.  
  551.     FlechaDerWidget=BUIx.B_TextWidget(Scorer.wFrame,"FlechaDerWidget",">",ScorerWidgets.font_server,"../../Data/Letras menu gra.bmp")
  552.     FlechaDerWidget.SetAlpha(1)
  553.     FlechaDerWidget.SetColor(128,128,128)   
  554.     FlechaDerWidget.SetText(">")    
  555.     Scorer.wFrame.AddWidget(FlechaDerWidget,0.97,15,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  556.     FlechaDerWidget.SetVisible(1)
  557.     FlechaDerWidget.SetAutoScale(1)
  558.  
  559. def FadeTextInfo(time = 0.0):
  560.     if time < 1.0:
  561.         Bladex.AddScheduledFunc(Bladex.GetTime() + 0.02,FadeTextInfo,(time + 0.1,))
  562.     else:
  563.         time = 1.0
  564.  
  565.     InfoCharWidget1.SetAlpha(time)
  566.     InfoCharWidget2.SetAlpha(time)
  567.     InfoCharWidget3.SetAlpha(time)
  568.     InfoCharWidget4.SetAlpha(time)
  569.  
  570.  
  571. def FadeFondo(time = 0.0):
  572.     if time < 0.3:
  573.         Bladex.AddScheduledFunc(Bladex.GetTime() + 0.02,FadeFondo,(time + 0.02,))
  574.     else:
  575.         time = 0.3
  576.  
  577.     fondo1.SetAlpha(time * 3.33)
  578.     fondo2.SetAlpha(time * 3.33)
  579.     fondo3.SetAlpha(time * 3.33)
  580.  
  581. BBLib.ReadMMP("../../Data/seleccionamazona.mmp")
  582. BBLib.ReadMMP("../../Data/seleccionbarbaro.mmp")
  583. BBLib.ReadMMP("../../Data/seleccioncaballero.mmp")
  584. BBLib.ReadMMP("../../Data/seleccionenano.mmp")
  585.  
  586. def PrecargaBackgroundCharacters():
  587.     global fondo1
  588.     global fondo2
  589.     global fondo3   
  590.  
  591.     if fondo1 == 0:
  592.         TamX = 256.0
  593.         TamY = 256.0
  594.  
  595.         fondo1=BUIx.B_BitmapWidget(Scorer.wFrame,"FondoInfoChar",256,256,"AMZ1","../../Data/seleccionamazona.mmp")
  596.         fondo1.SetColor(255,255,255)
  597.         Scorer.wFrame.AddWidget(fondo1,0,0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  598.         fondo1.SetSize(TamX,TamY)
  599.         fondo1.SetAutoScale(2)
  600.  
  601.         fondo2=BUIx.B_BitmapWidget(Scorer.wFrame,"FondoInfoChar",256,256,"AMZ2","../../Data/seleccionamazona.mmp")
  602.         fondo2.SetColor(255,255,255)
  603.         Scorer.wFrame.AddWidget(fondo2,256.0,0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  604.         fondo2.SetSize(TamX,TamY)
  605.         fondo2.SetAutoScale(2)
  606.  
  607.         fondo3=BUIx.B_BitmapWidget(Scorer.wFrame,"FondoInfoChar",256,256,"AMZ3","../../Data/seleccionamazona.mmp")
  608.         fondo3.SetColor(255,255,255)
  609.         Scorer.wFrame.AddWidget(fondo3,0,256.0,BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  610.         fondo3.SetSize(TamX,TamY)
  611.         fondo3.SetAutoScale(2)
  612.  
  613.     fondo1.SetBitmap("AMZ1")
  614.     fondo2.SetBitmap("AMZ2")
  615.     fondo3.SetBitmap("AMZ3")
  616.  
  617.     fondo1.SetBitmap("BAR1")
  618.     fondo2.SetBitmap("BAR2")
  619.     fondo3.SetBitmap("BAR3")
  620.  
  621.     fondo1.SetBitmap("CAB1")
  622.     fondo2.SetBitmap("CAB2")
  623.     fondo3.SetBitmap("CAB3")
  624.  
  625.     fondo1.SetBitmap("ENA1")
  626.     fondo2.SetBitmap("ENA2")
  627.     fondo3.SetBitmap("ENA3")
  628.  
  629.  
  630. def ActivateWiggetInfoChar():
  631.  
  632.     if CurrentPerson == 0:
  633.         InfoCharWidget1.SetText(TextInfoCharAmz1)
  634.         InfoCharWidget2.SetText(TextInfoCharAmz2)
  635.         InfoCharWidget3.SetText(TextInfoCharAmz3)
  636.         InfoCharWidget4.SetText(TextInfoCharAmz4)
  637.  
  638.         fondo1.SetBitmap("AMZ1")
  639.         fondo2.SetBitmap("AMZ2")
  640.         fondo3.SetBitmap("AMZ3")
  641.     elif CurrentPerson == 1:
  642.         InfoCharWidget1.SetText(TextInfoCharBar1)
  643.         InfoCharWidget2.SetText(TextInfoCharBar2)
  644.         InfoCharWidget3.SetText(TextInfoCharBar3)
  645.         InfoCharWidget4.SetText(TextInfoCharBar4)
  646.  
  647.         fondo1.SetBitmap("BAR1")
  648.         fondo2.SetBitmap("BAR2")
  649.         fondo3.SetBitmap("BAR3")
  650.     elif CurrentPerson == 2:
  651.         InfoCharWidget1.SetText(TextInfoCharKgt1)
  652.         InfoCharWidget2.SetText(TextInfoCharKgt2)
  653.         InfoCharWidget3.SetText(TextInfoCharKgt3)
  654.         InfoCharWidget4.SetText(TextInfoCharKgt4)
  655.         
  656.         fondo1.SetBitmap("CAB1")
  657.         fondo2.SetBitmap("CAB2")
  658.         fondo3.SetBitmap("CAB3")
  659.     elif CurrentPerson == 3:
  660.         InfoCharWidget1.SetText(TextInfoCharDwf1)
  661.         InfoCharWidget2.SetText(TextInfoCharDwf2)
  662.         InfoCharWidget3.SetText(TextInfoCharDwf3)
  663.         InfoCharWidget4.SetText(TextInfoCharDwf4)
  664.         
  665.         fondo1.SetBitmap("ENA1")
  666.         fondo2.SetBitmap("ENA2")
  667.         fondo3.SetBitmap("ENA3")
  668.  
  669.     
  670.     fondo1.SetVisible(1)
  671.     fondo2.SetVisible(1)
  672.     fondo3.SetVisible(1)
  673.     FadeFondo()
  674.     
  675.     InfoCharWidget1.SetVisible(1)
  676.     InfoCharWidget2.SetVisible(1)
  677.     InfoCharWidget3.SetVisible(1)
  678.     InfoCharWidget4.SetVisible(1)
  679.  
  680.     InfoCharWidget1.SetAlpha(0)
  681.     InfoCharWidget2.SetAlpha(0)
  682.     InfoCharWidget3.SetAlpha(0)
  683.     InfoCharWidget4.SetAlpha(0)
  684.  
  685.     Bladex.AddScheduledFunc(Bladex.GetTime() + 0.3,FadeTextInfo,())
  686.     Bladex.AddScheduledFunc(Bladex.GetTime() + 0.5,ScreenSelectionFinish,())
  687.  
  688.     ActivateWidgetYesNo()
  689.     
  690.     AreYouSureWidget.SetVisible(1)  
  691.     YesWidget.SetVisible(1)
  692.     NoWidget.SetVisible(1)
  693.  
  694.     Scorer.wFrame.RecalcLayout()
  695.  
  696.  
  697. ScreenSelectionFinished = 1
  698.  
  699. def ScreenSelectionFinish():
  700.     global ScreenSelectionFinished
  701.  
  702.     ScreenSelectionFinished = 1
  703.  
  704.  
  705. Bladex.AddScheduledFunc(Bladex.GetTime() + 0.3,FadeTextInfo,())
  706.  
  707.  
  708.  
  709. def ActivateWidgetYesNo():
  710.     global YesNoValue   
  711.  
  712.     if (YesNoValue):
  713.         YesWidget.SetColor(128,128,128)
  714.         NoWidget.SetColor(255,255,255)
  715.         YesNoValue = 0
  716.     else:
  717.         YesWidget.SetColor(255,255,255)
  718.         NoWidget.SetColor(128,128,128)
  719.         YesNoValue = 1
  720.  
  721. def CreateWidgetAreYouSure():
  722.     global SelectCharacterWidget
  723.     global AreYouSureWidget
  724.     global YesWidget
  725.     global NoWidget 
  726.     
  727.     SelectCharacterWidget=BUIx.B_TextWidget(Scorer.wFrame,"SelectCharacter","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  728.     SelectCharacterWidget.SetAlpha(1)
  729.     SelectCharacterWidget.SetColor(128,128,128) 
  730.     SelectCharacterWidget.SetText("Press arrows to choose character/Press enter to select")   
  731.  
  732.     AreYouSureWidget=BUIx.B_TextWidget(Scorer.wFrame,"AreYouSure","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  733.     AreYouSureWidget.SetAlpha(1)
  734.     AreYouSureWidget.SetColor(255,255,255)  
  735.     AreYouSureWidget.SetText("ARE YOU SURE?")
  736.     
  737.     YesWidget=BUIx.B_TextWidget(Scorer.wFrame,"Yes","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  738.     YesWidget.SetAlpha(1)
  739.     YesWidget.SetColor(128,128,128)
  740.     YesWidget.SetText("Yes")
  741.     
  742.     NoWidget=BUIx.B_TextWidget(Scorer.wFrame,"No","",ScorerWidgets.font_server,"../../Data/Letras menu med.bmp")
  743.     NoWidget.SetAlpha(1)
  744.     NoWidget.SetColor(128,128,128)
  745.     NoWidget.SetText("No")
  746.     
  747.     Scorer.wFrame.AddWidget(SelectCharacterWidget,0.50,22.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  748.     Scorer.wFrame.AddWidget(AreYouSureWidget,0.45,23.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  749.     Scorer.wFrame.AddWidget(YesWidget,0.56,23.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  750.     Scorer.wFrame.AddWidget(NoWidget,0.60,23.0,BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,BUIx.B_FrameWidget.B_FR_AbsoluteBottom,BUIx.B_FrameWidget.B_FR_Bottom)
  751.  
  752.     SelectCharacterWidget.SetVisible(1)
  753.     AreYouSureWidget.SetVisible(0)
  754.     YesWidget.SetVisible(0)
  755.     NoWidget.SetVisible(0)  
  756.  
  757. last_start_time = 0
  758. last_fade_time = 0
  759. Forward_Arrow = 1
  760.  
  761. def FadeArrow(fade):
  762.     global last_fade_time
  763.     global StateArrow
  764.  
  765.     StateArrow = fade + 1
  766.     last_fade_time = Bladex.GetTime()
  767.  
  768.  
  769. def MoveArrow(entity,time):
  770.     global last_start_time
  771.     global Forward_Arrow
  772.     global StateArrow
  773.  
  774.     if StateArrow:
  775.         delta_time = time - last_start_time
  776.  
  777.         if delta_time >= 0.33:
  778.             last_start_time = time
  779.             delta_time = 0
  780.  
  781.             if Forward_Arrow:
  782.                 Forward_Arrow = 0
  783.             else:
  784.                 Forward_Arrow = 1
  785.  
  786.         Disp = delta_time * 0.03
  787.  
  788.         Y = 15.0
  789.  
  790.         if Forward_Arrow:
  791.             Scorer.wFrame.MoveWidgetTo("FlechaIzqWidget",0.03 - Disp,Y)
  792.             Scorer.wFrame.MoveWidgetTo("FlechaDerWidget",0.97 + Disp,Y)
  793.         else:
  794.             Scorer.wFrame.MoveWidgetTo("FlechaIzqWidget",0.02 + Disp,Y)
  795.             Scorer.wFrame.MoveWidgetTo("FlechaDerWidget",0.98 - Disp,Y)
  796.     if StateArrow == 2:     
  797.         delta_time = time - last_fade_time
  798.         delta_time = delta_time * 2.0
  799.         
  800.         if delta_time >= 1.0:
  801.             delta_time = 1.0
  802.             StateArrow = 0
  803.         
  804.         alpha = 1.0 - delta_time        
  805.         
  806.         FlechaIzqWidget.SetAlpha(alpha)
  807.         FlechaDerWidget.SetAlpha(alpha)
  808.     elif StateArrow == 3:
  809.         alpha = time - last_fade_time
  810.         alpha = alpha * 2.0
  811.         
  812.         if alpha <= 0.0:
  813.             delta_time = 0.0
  814.             StateArrow = 1
  815.             #FlechaIzqWidget.SetAlpha(alpha)
  816.             #FlechaDerWidget.SetAlpha(alpha)
  817.         
  818.         FlechaIzqWidget.SetAlpha(alpha)
  819.         FlechaDerWidget.SetAlpha(alpha)
  820.  
  821.  
  822. char = Bladex.GetEntity("Player1")
  823. char.TimerFunc = MoveArrow
  824. char.SubscribeToList("Timer60")
  825.  
  826. #Scorer.wFrame.MoveWidgetTo("Yes",0.6,30)
  827. #Scorer.wFrame.MoveWidgetTo("No",0.65,30)
  828.     
  829. def PressKeyEnter():
  830.     global ScreenSelectionFinished
  831.     global YesNoValue
  832.     global YesNoActivated
  833.  
  834.     if YesNoActivated:
  835.         print "YesNoActivated 1"
  836.         if ScreenSelectionFinished: 
  837.             print "ScreenSelectionFinished 1"
  838.             ScreenSelectionFinished = 0
  839.  
  840.             YesNoActivated = 0
  841.             AreYouSureWidget.SetVisible(0)
  842.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.6,SelectCharacterWidget.SetVisible,(1,))
  843.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.6,ScreenSelectionFinish,())
  844.             YesWidget.SetVisible(0)
  845.             NoWidget.SetVisible(0)
  846.             
  847.             InfoCharWidget1.SetVisible(0)
  848.             InfoCharWidget2.SetVisible(0)
  849.             InfoCharWidget3.SetVisible(0)
  850.             InfoCharWidget4.SetVisible(0)
  851.             
  852.             fondo1.SetVisible(0)
  853.             fondo2.SetVisible(0)
  854.             fondo3.SetVisible(0)
  855.             FlechaIzqWidget.SetVisible(1)
  856.             FlechaDerWidget.SetVisible(1)
  857.             
  858.             SlideFrame(1)
  859.  
  860.             if YesNoValue:
  861.                 print "YesNoValue 1"
  862.                 Menu.SwitchToCasaMenu()
  863.                 Menu.ActivateMenu()
  864.                 Menu.Character = CurrentPerson
  865.         
  866.                 File = open("..\\2DMap\\2dMapData.txt","w")
  867.                 if CurrentPerson == 0:
  868.                     File.write("AM")
  869.                 if CurrentPerson == 1:
  870.                     File.write("BR")
  871.                 if CurrentPerson == 2:
  872.                     File.write("KN")
  873.                 if CurrentPerson == 3:
  874.                     File.write("DW")
  875.                 File.close()
  876.     elif Stoped:
  877.         if ScreenSelectionFinished:        
  878.             if Reference.DEMO_MODE==1 and CurrentPerson == 0 and ("AM" not in Reference.DEMO_PLAYERS):
  879.                 print "Amazon not available in demo"
  880.                 GameText.WriteTextAux(MenuText.GetMenuText("Amazon not available in demo mode"),2.0,255,255,255,[])
  881.                 return
  882.             if Reference.DEMO_MODE==1 and CurrentPerson == 1 and ("BR" not in Reference.DEMO_PLAYERS):
  883.                 print "Barbarian not available in demo"
  884.                 GameText.WriteTextAux(MenuText.GetMenuText("Barbarian not available in demo mode"),2.0,255,255,255,[])
  885.                 return
  886.             if Reference.DEMO_MODE==1 and CurrentPerson == 2 and ("KN" not in Reference.DEMO_PLAYERS):
  887.                 print "Knight not available in demo"
  888.                 GameText.WriteTextAux(MenuText.GetMenuText("Knight not available in demo mode"),2.0,255,255,255,[])
  889.                 return
  890.             if Reference.DEMO_MODE==1 and CurrentPerson == 3 and ("DW" not in Reference.DEMO_PLAYERS):
  891.                 print "Dwarf not available in demo"
  892.                 GameText.WriteTextAux(MenuText.GetMenuText("Dwarf not available in demo mode"),2.0,255,255,255,[])
  893.                 return
  894.  
  895.             ScreenSelectionFinished = 0
  896.             YesNoActivated = 1
  897.             YesNoValue = 0          
  898.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.6,ActivateWiggetInfoChar,())
  899.             SelectCharacterWidget.SetVisible(0)
  900.             FlechaIzqWidget.SetVisible(0)
  901.             FlechaDerWidget.SetVisible(0)
  902.             SlideFrame(0)
  903.             marco1.SetVisible(1)
  904.             marco2.SetVisible(1)
  905.             marco3.SetVisible(1)
  906.             marco4.SetVisible(1)
  907.             marco5.SetVisible(1)
  908.             marco6.SetVisible(1)
  909.  
  910. CreateWidgetAreYouSure()
  911. CreateWidgetInfoChar()
  912. CreateWidgetMarco()
  913.  
  914. def PressKeyEsc():
  915.     global YesNoActivated
  916.     global ScreenSelectionFinished
  917.  
  918.     if YesNoActivated:
  919.         if ScreenSelectionFinished:
  920.             ScreenSelectionFinished = 0
  921.             YesNoActivated = 0
  922.             AreYouSureWidget.SetVisible(0)          
  923.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.6,SelectCharacterWidget.SetVisible,(1,))
  924.             Bladex.AddScheduledFunc(Bladex.GetTime() + 0.6,ScreenSelectionFinish,())
  925.             YesWidget.SetVisible(0)
  926.             NoWidget.SetVisible(0)
  927.             
  928.             InfoCharWidget1.SetVisible(0)
  929.             InfoCharWidget2.SetVisible(0)
  930.             InfoCharWidget3.SetVisible(0)
  931.             InfoCharWidget4.SetVisible(0)
  932.             
  933.             fondo1.SetVisible(0)
  934.             fondo2.SetVisible(0)
  935.             fondo3.SetVisible(0)
  936.             FlechaIzqWidget.SetVisible(1)
  937.             FlechaDerWidget.SetVisible(1)
  938.             SlideFrame(1)
  939.     else:
  940.         Menu.ActivateMenu()
  941.  
  942. import BInput
  943.  
  944. InputManager=BInput.GetInputManager()
  945. LastOne = InputManager.GetInputActionsSet()
  946. InputManager.SetInputActionsSet("Default")
  947.  
  948. Bladex.AddInputAction("Retrocede",0)
  949. Bladex.AddInputAction("Avanza",0)
  950. Bladex.AddInputAction("Selecciona",0)
  951. Bladex.AddInputAction("Cancelar",0)
  952.     
  953. def RedefineKeys():
  954.     import BInput
  955.     
  956.     InputManager=BInput.GetInputManager()
  957.     LastOne = InputManager.GetInputActionsSet()
  958.     InputManager.SetInputActionsSet("Default")
  959.  
  960.     Bladex.AssocKey("Retrocede","Keyboard","Right")
  961.     Bladex.AssocKey("Avanza","Keyboard","Left")
  962.     Bladex.AssocKey("Selecciona","Keyboard","Enter")
  963.     Bladex.AssocKey("Cancelar","Keyboard","Esc")
  964.  
  965.     InputManager.SetInputActionsSet(LastOne)
  966.  
  967. KeybWidget.AdditionalKeysCallBack = RedefineKeys
  968.  
  969. RedefineKeys()
  970.  
  971. Bladex.AddBoundFunc("Retrocede",PressKeyX)
  972. Bladex.AddBoundFunc("Avanza",PressKeyZ)
  973. Bladex.AddBoundFunc("Selecciona",PressKeyEnter)
  974. Bladex.AddBoundFunc("Cancelar",PressKeyEsc)
  975. InputManager.SetInputActionsSet(LastOne)
  976.  
  977.  
  978. HouseActive = 0
  979.  
  980. # funcion callback indica que El Usuario Presiona La Tecla Escape
  981. def ElUsuarioPresionaLaTeclaEscape(Salio):
  982.     global HouseActive
  983.     if Salio:
  984.         HouseActive = 1     
  985.     else:
  986.         if HouseActive:
  987.             Menu.SwitchToGlobalMenu()
  988.         return not HouseActive
  989.     
  990.     
  991.     
  992. Menu.EscapeFunction = ElUsuarioPresionaLaTeclaEscape
  993.  
  994. def SetDefaultPerson():
  995.     global CurrentPerson
  996.     global FinishPerson
  997.  
  998.     CurrentPerson = 3
  999.     FinishPerson = 3
  1000.  
  1001.     cam = Bladex.GetEntity("Camera")
  1002.     cam.SetMaxCamera("Seleccion_Camera_seleccion_enano.cam",0,-1)
  1003.  
  1004. def ActivateStartWidgets():
  1005.     SelectCharacterWidget.SetVisible(1)
  1006.     FlechaDerWidget.SetVisible(1)
  1007.     FlechaIzqWidget.SetVisible(1)
  1008.  
  1009. def DeactivateStartWidgets():
  1010.     SelectCharacterWidget.SetVisible(0)
  1011.     FlechaDerWidget.SetVisible(0)
  1012.     FlechaIzqWidget.SetVisible(0)
  1013.  
  1014. def OnEnterDemoCasa():
  1015.     DeactivateStartWidgets()
  1016.  
  1017. def OnLeaveDemoCasa():
  1018.     global CurrentPerson
  1019.     ActivateStartWidgets()
  1020.     cam = Bladex.GetEntity("Camera")
  1021.     cam.SetMaxCamera(CameraPerson[CurrentPerson],0,-1)
  1022.     #SetDefaultPerson()
  1023.  
  1024. PrecargaBackgroundCharacters()
  1025.